<?php
/**
 * misc.php
 * Date & Time: 02/26/2015 - 17:28
 * @author: Geoffrey Embuscado
 * Description: Extra functions before resourcing other controller.
 * Note: Guys dito niyo na lang ilagay yung mga Routes ng pagexport ng reports at uploads
 */

// Dashboard Preview List
Route::get('order/preview-list/{status}/{limit?}', [ 'uses' => 'OrderController@getPreviewList' ]);
Route::get('top-up/preview-list/{limit?}', [ 'uses' => 'TopUpController@getPreviewList' ]);
Route::get('processing/preview-list/{limit?}', [ 'uses' => 'ProcessingController@getPreviewList' ]);
Route::get('po/preview-list/{level}/{status}/{limit?}', [ 'uses' => 'PurchaseOrderController@getPreviewList' ]);
Route::get('for-delivery/preview-list/{limit?}', [ 'uses' => 'ForDeliveryController@getPreviewList' ]);

// Order
Route::get('order/export-list/{print?}', [ 'uses' => 'OrderController@exportList' ]);
Route::get('order/export-options-list/{print?}', [ 'uses' => 'OrderController@exportOptionList' ]);

// Cancel Order Product
Route::post('order/cancelOrderProduct', [ 'uses' => 'OrderController@cancelOrderProduct' ]);

// Order getForm for changing status
Route::get('order/getFormChangeStatus', [ 'uses' => 'OrderController@getFormChangeStatus']);

// User Image Upload - Create
Route::post('user/uploadNewUserImage', [ 'uses' => 'UserController@uploadNewUserImage']);

// User Signature Upload - Create
Route::post('user/uploadNewUserSignatureImage', [ 'uses' => 'UserController@uploadNewUserSignatureImage']);

// User Image Upload - Edit
Route::post('user/uploadUserImage/{id}', ['uses' => 'UserController@uploadUserImage']);

// User Signature Upload - Edit
Route::post('user/uploadUserSignatureImage/{id}', [ 'uses' => 'UserController@uploadUserSignatureImage']);
// Processing Items Data Retrieving Per Company
Route::get('processing/getOrderItems/{selected_items}/{vendor}/{enable_po?}', ['uses' => 'ProcessingController@getOrderItems'] );

// Send Product Voucher
Route::get('po/sendVoucher/{id}', [ 'uses' => 'PurchaseOrderController@sendVoucher' ]);

// Edits Product Voucher
Route::get('po/editVoucher/{id}', [ 'uses' => 'PurchaseOrderController@editVoucherForm' ]);

// Updates Voucher Details
Route::post('po/updateVoucherDetails', [ 'uses' => 'PurchaseOrderController@updateVoucherDetails' ]);

// POST upload of deposit slip for topup
Route::post('top-up/uploadDepositSlipRef', [ 'uses' => 'TopUpController@uploadDepositSlipRef' ]);

// POST Save additional reference details
Route::post('top-up/saveReferenceDetails', [ 'uses' => 'TopUpController@saveReferenceDetails' ]);

// Get Reference Detais
Route::get('top-up/{id}/getReferenceManager', [ 'uses' => 'TopUpController@getReferenceManager' ]);

// PO get Details
Route::get('po/getPurchaseOrderdetails/{id}', [ 'uses' => 'PurchaseOrderController@getPurchaseOrderdetails' ]);

// Po Export
Route::get('po/export/{id}/{template?}/{print?}', 'PurchaseOrderController@export');

// Po Export List
Route::get('po/export-list/{print?}', 'PurchaseOrderController@exportList');

// PO Generate Stickers
Route::get('po/generate-stickers/{ids}/{download?}', [ 'uses' => 'PurchaseOrderController@generateStickers' ]);

// Approve selected PO
Route::post('po/approvePurchaseOrders', [ 'uses' => 'PurchaseOrderController@approvePurchaseOrders' ]);

// Upload of Approved PO status
Route::get('po/uploadPurchaseOrderStatus', [ 'uses' => 'PurchaseOrderController@uploadPurchaseOrderStatus' ]);

Route::post('po/postUploadPurchaseOrderStatus', [ 'uses' => 'PurchaseOrderController@postUploadPurchaseOrderStatus' ]);

// Upload of Sales Order Order Status 
Route::get('for-delivery/uploadSalesOrderStatus', [ 'uses' => 'ForDeliveryController@uploadSalesOrderStatus' ]);

// Upload of Sales Order Status POST ajax
Route::post('for-delivery/postSalesOrderStatus', [ 'uses' => 'ForDeliveryController@postSalesOrderStatus' ]);

// Upload for delivery to completed
Route::post('for-delivery/postUploadForDeliveryCompleted', [ 'uses' => 'ForDeliveryController@postUploadForDeliveryCompleted' ]);

// Generate PickList
//Route::get('for-delivery/generatePicklist', [ 'uses' => 'ForDeliveryController@generatePicklist' ]);

Route::get('for-delivery/generatePicklist', [ 'uses' => 'ForDeliveryController@generatePicklist' ]);

Route::get('for-delivery/generateDR', [ 'uses' => 'ForDeliveryController@generateDR' ]);

// Upload Module
// Get Upload Format
Route::get('upload/upload-format', [ 'uses' => 'UploadController@getUploadFormat' ] );